home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / ifp1s155.zip / PAGE_02.PAS < prev    next >
Pascal/Delphi Source File  |  1992-04-21  |  4KB  |  135 lines

  1. unit page_02;
  2.  
  3. interface
  4.  
  5. uses crt, ifpglobl, ifpcomon, ifpextrn;
  6.  
  7. procedure page02;
  8.  
  9. implementation
  10.  
  11. procedure page02;
  12.  
  13. var
  14.   cpu_info: cpu_info_t;
  15.   save_cpu_type: byte;
  16.  
  17. procedure showNDP(a: string; b: word);
  18.   begin
  19.   writeln(a);
  20.   caption2('  Infinity');
  21.   case b and $1000 of
  22.     $0000 : writeln('projective');
  23.     $1000 : writeln('affine')
  24.   end;
  25.   caption2('  Rounding');
  26.   case b and $0C00 of
  27.     $0000 : writeln('to nearest or even');
  28.     $0400 : writeln('down');
  29.     $0800 : writeln('up');
  30.     $0C00 : writeln('chop')
  31.   end;
  32.   caption2('  Precision');
  33.   case b and $0300 of
  34.     $0000 : writeln('24 bits');
  35.     $0100 : writeln('(reserved)');
  36.     $0200 : writeln('53 bits');
  37.     $0300 : writeln('64 bits')
  38.   end
  39.   end; {showNDP}
  40.  
  41.   begin (* procedure page_02 *)
  42.   caption2('CPU');
  43.   cpu_info.test_type:='C';
  44.   CPUID(cpu_info);
  45.   with cpu_info do
  46.     begin
  47.     case cpu_type of
  48.       $00 : Writeln('8088');
  49.       $01 : Writeln('8086');
  50.       $02 : Writeln('V20');
  51.       $03 : Writeln('V30');
  52.       $04 : Writeln('80188');
  53.       $05 : Writeln('80186');
  54.       $06 : Writeln('80286');
  55.       $07 : begin
  56.             Write('i386');
  57.             if bugtst <> 0 then
  58.               Writeln(' - Contains POPAD bug (DON''T WORRY! Most 386''s have this)')
  59.             else
  60.               Writeln;
  61.             end;
  62.       $08 : begin
  63.             test_type:='N';
  64.             CPUID(cpu_info);
  65.             if ndp_type = 0 then
  66.               Writeln('i486SX')
  67.             else
  68.               Writeln('i486')
  69.             end
  70.       else
  71.         unknown('CPU', cpu_type, 2)
  72.     end;
  73.     save_cpu_type:=cpu_type;
  74.     case cpu_type of
  75.       $06..$08 : begin
  76.                  caption3('Machine Status Word');
  77.                  writeln(hex(MSW, 4));
  78.                  caption3('  Bit 0 - Protected mode     ');
  79.                  yesorno(MSW and 1 = 1);
  80.                  caption3('  Bit 1 - Monitor Coprocessor');
  81.                  yesorno(MSW and 2 = 2);
  82.                  caption3('  Bit 2 - Emulate Coprocessor');
  83.                  yesorno(MSW and 4 = 4);
  84.                  caption3('Global Descriptor Table   ');
  85.                  for i:=1 to 6 do
  86.                    write(hex(GDT[i], 2), ' ');
  87.                  writeln;
  88.                  caption3('Interrupt Descriptor Table');
  89.                  for i:=1 to 6 do
  90.                    write(hex(IDT[i], 2), ' ');
  91.                  writeln
  92.                  end
  93.     end;
  94.     caption3('Interrupts acknowledged immediately after segment register change');
  95.     yesorno(intflag);
  96.     caption2('Coprocessor');
  97.     test_type:='N';
  98.     CPUID(cpu_info);
  99.     case ndp_type of
  100.       $00 : writeln('none');
  101.       $01 : showNDP('8087', ndp_cw);
  102.       $02 : showNDP('80287', ndp_cw);
  103.       $03 : if save_cpu_type = $08 then
  104.               showNDP('(built-in)', ndp_cw) {'486 has coprocessor built in}
  105.             else
  106.               if save_cpu_type = $06 then
  107.                 showNDP('80287XL', ndp_cw)
  108.               else
  109.                 showNDP('80387', ndp_cw);
  110.     else
  111.       unknown('coprocessor', ndp_type, 4)
  112.     end {case}
  113.   end;
  114.   caption2('BIOS coprocessor flag set');
  115.   yesorno(equip and $0002 = $0002);
  116.   caption2('BIOS Weitek coprocessor flag set');
  117.   with cpu_info do
  118.     begin
  119.     if (save_cpu_type = 7) or (save_cpu_type = 8) then
  120.       begin
  121.       test_type:='W';
  122.       CPUID(cpu_info);
  123.       yesorno(weitek and 1 = 1);
  124.       if weitek and 1 = 1 then
  125.         begin
  126.         caption3('Weitek addressable in real mode');
  127.         yesorno(weitek and $80 = $80)
  128.         end
  129.       end
  130.     else
  131.       Writeln('Not Applicable');
  132.     end;
  133.   end;
  134. end.
  135.